package ying.sms;

import java.time.LocalDate;

/**
 * ClassName: MiddleStudents
 * Package: sms
 * Description:
 *
 * @Author 刘英杰
 * @Create 2024/5/17 19:02
 * @Version 1.0
 */
public class MiddleStudents extends Student implements EveningStudy {

    private Integer historyScore;
    private Integer physicsScore;

    public MiddleStudents(Integer id, String name, Integer chineseScore, Integer mathScore,
                          Integer historyScore, Integer physicsScore) {
        super(id, name, chineseScore, mathScore);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    public MiddleStudents(Integer id, String name, Integer chineseScore, Integer mathScore,
                          Integer historyScore, Integer physicsScore, LocalDate enrollmentDates) {
        super(id, name, chineseScore, mathScore, enrollmentDates);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    public MiddleStudents(Integer id, String name, Integer chineseScore, Integer mathScore,
                          LocalDate enrollmentDates, String emal, Integer historyScore, Integer physicsScore) {
        super(id, name, chineseScore, mathScore, enrollmentDates, emal);
        this.historyScore = historyScore;
        this.physicsScore = physicsScore;
    }

    @Override
    public void eveningStudy() {
        System.out.println("初中生" + getName() + "上晚自习");
    }

    public Integer getHistoryScore() {
        return historyScore;
    }

    public void setHistoryScore(Integer historyScore) {
        this.historyScore = historyScore;
    }

    public Integer getPhysicsScore() {
        return physicsScore;
    }

    public void setPhysicsScore(Integer physicsScore) {
        this.physicsScore = physicsScore;
    }

    @Override
    public Integer getTotolScore() {
        return super.getTotolScore() + historyScore + physicsScore;
    }

    @Override
    public String toString() {
        return getId() + " " + getName() + " " + getChineseScore() + " " + getMathScore() + " "
                + getHistoryScore() + " " + getPhysicsScore() + " "
                + " " + " "  + getEmal() + " " + getEnrollmentDates() + " " + getTotolScore();
    }
}
